import request from "../request.js";
//登录
export function login(params) {
  console.log(params);
  return request({
    url: "/user/LogingSystem",
    data: params
  });
}
//获取当前登录用户信息
export function userInfo(params) {
  return request({
    url: "/user/GetCurrentLoginUser",
    data: params
  });
}
//获取菜单信息
export function getMenu(params) {
  // 接口请求
  // return request({
  //   url: "/user/GetMenuList",
  //   data: params
  // });
  return new Promise(function(resolve, reject) {
    //只能使用字符串
    //子路由的component 为views下的目录
    //举例：views目录下的login/index路径 component只需要设置成'login/index'即可
    let resultData = [
      {
        name: "system",
        path: "/system",
        component: "layout", //代表使用的是全局模板
        meta: {
          title: "系统设置",
          icon: "example"
        },
        children: [
          {
            name: "PlatfromList",
            path: "/platform/list",
            component: "system/platform/list",
            meta: {
              title: "平台管理",
              icon: "user"
            }
          },
          {
            path: "/platform/edit/:id(\\d+)",
            component: "system/platform/edit",
            name: "EditPlatform",
            meta: {
              title: "编辑平台",
              noCache: true
            },
            hidden: true
          },
          {
            path: "/platform/create",
            component: "system/platform/create",
            name: "CreatePlatform",
            meta: {
              title: "创建平台",
              noCache: true
            },
            hidden: true
          }
        ]
      },
      {
        name: "404页面",
        path: "*",
        redirect: "/404",
        hidden: true
      }
    ];
    resolve({ Success: true, DataValue: resultData, Code: "0" });
  });
}
